#pragma once
#include<iostream>
namespace cxs
{
	template<typename T>
	class Vector
	{
	public:
		typedef T value_type;
		typedef T* iterator;

		Vector()
			:_start(nullptr)
			,_finish(nullptr)
			, _endofstorage(nullptr)
		{
			;
		}

		~Vector()
		{
			delete T[_capacity];

		}

		T* reserve(size_t n)
		{
			int sz = size();
			if (n > _capacity)
			{
				if (start != nullptr)
				{
					T* tmp = new T[n];
					memcpy(tmp, _start, sizeof(T) * sz);//size()
					delete[]_start;
					_start = tmp;
				}
				_start = tmp;
				_finish=tmp+sz;
				_endofstorage = tmp + n;
			}
		}

		size_t _size()
		{
			return (_finish - _start);
		}

		size_t _capacity()
		{
			return(_endofstorage - _start);
		}
	private:
		iterator _start;
		iterator _finish;
		iterator _endofstorage;
		
	};

}


